<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="btn" onclick="console.log(this,'hello click')">button</button>
    <script>
      const btn = document.getElementById("btn");

      // 属性事件绑定
      // btn.onclick = function () {
      //   console.log(this);
      // };

      // btn.click(); // this===btn
      // 用户行为本质上就是 btn.click()
    </script>
  </body>
</html>
